Namespace Services
    Public Class KatepistevmaAmountCalculator
        Implements IAmountCalculator

        Public Sub applyAmount(claim As Model.Claim, percentage As Decimal) Implements IAmountCalculator.applyAmount

            If claim.KatPerc1 = 100.0 Or claim.KatPerc2 = 100.0 Or _
                    claim.KatPerc3 = 100.0 Or claim.KatPerc4 = 100.0 Or claim.KatPerc5 = 100.0 Then
                ' DO NOTHING - Claim's ΚΑΤΑΠΙΣΤΕΥΜΑ part has been fully settled
            Else
                If claim.KatPerc1 = 0.0 Then
                    claim.KatPerc1 = percentage
                Else
                    If claim.KatPerc2 = 0.0 Then
                        claim.KatPerc2 = percentage
                    Else
                        If claim.KatPerc3 = 0.0 Then
                            claim.KatPerc3 = percentage
                        Else
                            If claim.KatPerc4 = 0.0 Then
                                claim.KatPerc4 = percentage
                            Else
                                claim.KatPerc5 = percentage
                            End If
                        End If
                    End If
                End If
            End If
        End Sub

    End Class
End Namespace
